/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.service;

import cz.muni.dto.ShipmentDTO;
import cz.muni.entities.Courier;
import java.util.List;

/**
 *
 * @author sparrow
 */
public interface ShipmentServiceLocal {
     /**
     * Insert object into the DB Table
     * 
     * @param  ShipmentDTO we want to insert into the DB
     * @return void
     */
    void create(ShipmentDTO s);
    
    /**
     * Delete object from DB
     * 
     * @param ShipmentDTO object we want to remove from DB
     */ 
    void delete(final ShipmentDTO t);
    
    /**
     * Find shipment in DB by Long id
     * 
     * @param id id of object we want to find
     * @return object or null
     */
    ShipmentDTO find(Long id);
    
    /**
     * Update shipment in DB
     * 
     * @param ShipmentDTO to be updated
     * @return Updated shipment or null if object is not stored in DB
     */
    ShipmentDTO update(final ShipmentDTO t);
    
    /**
     * Find all Shipments
     * 
     * @return list of all Shipments
     */
    List<ShipmentDTO> findAll();
    
    /**
     * Find all Shipments in entred state
     * 
     * @param state find only shipments is this state
     * @return list of Shipments in entred state or null
     */
    List<ShipmentDTO> findByState(final String state);
    
    /**
     * Find all Shipments with selected state and courier. Both can be null.
     * 
     * @param state find only shipments in this state
     * @param courier find only shipments with this courier
     * @return list of Shipments in entred state with selected courier
     */
    List<ShipmentDTO> findByStateAndCourier(final String state, final Courier courier);
    
    /**
     * Find Shipment with entred tracking number. Logs if there are more(and return null).
     * 
     * @param number find only shipments with this tracking number
     * @return list of Shipments in entred state or null
     */
    ShipmentDTO findByTrackingNumber(final Long number);
}
